public class HockeyPlayer implements Comparable<HockeyPlayer>{
	private String firstName;
	private String lastName;

	private int goals;
	private int assists;

	public HockeyPlayer(String inFirstName, String inLastName) {
		firstName = inFirstName;
		lastName = inLastName;
		
		goals = 0;
		assists = 0;
	}
	
	public int getGoals() {
		return goals;
	}
	
	public int getAssists() {
		return assists;
	}
	
	public void addGoal() {
		goals++;
	}
	
	public int getTotalPoints() {
		return goals + assists;
	}
	
	public String getFirstName() {
		return firstName;
	}
	
	public String getLastName() {
		return lastName;
	}
	
	// works, but not the predefined way
	
	public boolean isAMatchFor(HockeyPlayer another) {
		String otherFirstName = another.getFirstName();
		String otherLastName = another.getLastName();
		
		if( ! firstName.equals(otherFirstName)) {
				return false;
			}
		
		if( ! lastName.equals(otherLastName)) {
			return false;
		}
		
		return true;

	}
	
	
	@Override
	public boolean equals(Object something) {
		HockeyPlayer another = (HockeyPlayer) something;
		
		if( ! firstName.equals(another.firstName)) {
				return false;
			}
		
		if( ! lastName.equals(another.lastName)) {
			return false;
		}
		
		return true;

	}
	
	public int compareTo(HockeyPlayer another) {
		int myTotalPoints = getTotalPoints();
		int otherTotalPoints = another.getTotalPoints();
		
		int difference = myTotalPoints - otherTotalPoints;
		
		if(difference != 0) {
			return difference;
		}
		
		difference = firstName.compareTo(another.getFirstName());
		
		return difference;
	}
	
	@Override
	public String toString() {
		String ret = "";
		
		ret += " firstName: " + firstName;
		ret += " lastName: " + lastName;
		
		return ret;
	}
}
